<!doctype html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <link rel="icon" href="__PUBLIC__/Image/logo.ico">
  
   <!-- Bootstrap core CSS -->
    <link href="__PUBLIC__/Css/lib/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/Css/Index/common.css" rel="stylesheet" type="text/css">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  
  <style type="text/css">
	/*左侧导航区*/
	.side {
		 position:absolute; left:0; top:0px; bottom:0px;
		 width:250px;
		 overflow: hidden;
		 background-image: url('__PUBLIC__/Image/Index/left_bg.jpg');
		 background-size:100% 100%;
	}
	/*分割线*/
	.break {
		 position:absolute; left:250px; top:0px; bottom:0px;
		 width:6px;
		 overflow:hidden;
	}
	/*右侧内容显示区*/
	.main {
		 position:absolute; left:256px; top:10px; bottom:10px; right:0px;
		 width:auto;
		 background-color:#fff;
		 z-index:2;
		 overflow:hidden;
	}
	
	/*导航标签样式*/
	#sideMenu a .sideLabel{
		float:right;
		width:200px; 
		height:40px;
		color:white;
		font-size: 20px;
		font-weight: 200;
		text-align: right;
		padding-right: 20px;
		padding-top: 10px;
		cursor:pointer;
	}
	
	a{
		text-decoration:none;
	}
	
	#sideMenu a .on{
		 width:228px;
		/* border:3px solid white; */
	}
	
	.break hr{
		margin:0;
		padding:0;
		border:0;
	}
	
	.contact{
		color:white;
		font-size:20px;
		font-weight:100;
		text-align:center;
	}
	
	.entryCityTable td{
		width:auto;
		padding-right:20px;
	}
	
	.change-city{
		background-color:#30D3BE;
		height:50px;
		float:right;
		width:200px;
		margin-top:10px;
	}
	
	@media screen and (max-height:800px){
		/*导航标签中的链接的样式*/
		#sideMenu a{
				float:right;
				margin-top:10px;
			}
	}
	@media screen and (min-height:800px){
		/*导航标签样式*/
		#sideMenu a .sideLabel{
			height:60px;
			padding-top: 20px;
		}
		
		/*导航标签中的链接的样式*/
		#sideMenu a{
			float:right;
			margin-top:30px;
		}
		
		.change-city{
			margin-top:30px;
		}
	}
	

</style>
  <!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  <script type="text/javascript" src="__PUBLIC__/Js/lib/jquery-1.11.2.min.js"></script>
  <script src="__PUBLIC__/Js/lib/bootstrap.min.js"></script>
  <script src="__PUBLIC__/Js/Index/common.js"></script>
  <script type="text/javascript">
	  $(function(){
		  checkHasLogined("__URL__/checkHasLogined");
		  
		  // 给选中的导航标签添加"on"这个class
		  $(".sideLabel").each(function(){
	    	  $(this).click(function(){
	    		  if($(this).attr("id") == "personCenter"){
	    				// 检查是否已经登录
	    				if($.trim($("#loginUser").val()) === ""){
	    					alert("您还没有登录，请先登录!");
	    				} else {
	    					$(".sideLabel").each(function(){
	   	    	    		 $(this).removeClass("on"); 
	   	    	    	  });
	   	    		  	$(this).addClass("on");
	    					rightLink("__URL__/personCenter")
	    				}
	    		  } else {
	    			  $(".sideLabel").each(function(){
		    	    		 $(this).removeClass("on"); 
		    	    	  });
		    		  $(this).addClass("on");
	    			  rightLink($(this).parents("a").attr("href"));
	    		  }
	    	  });
	      });

		  // 显示切换城市的弹出框
		  $("#changeCityLink").on("mouseover",function(){
			  $("[data-toggle='popover']").popover("show");
		  });
		  
		  // 移动鼠标隐藏切换城市弹出框
		  $("#changeCityLink").on("mouseleave",function(event){
			  // 鼠标移向可选择的城市以外的地方时
			  if($(event.relatedTarget).parents(".popover") == null
			     || $(event.relatedTarget).parents(".popover") == undefined
			     || $(event.relatedTarget).parents(".popover").length == 0){
				  $("[data-toggle='popover']").popover("hide");
			  }
		  });
		  
		  // 为切换城市弹出框添加事件。
		  $("[data-toggle='popover']").on('shown.bs.popover', function () {
			  $(".popover").on("mouseleave",function(event){
				  $("[data-toggle='popover']").popover("hide");
			  });
		   });
	  });
	  
	  function rightLink(url){
			$("#rightMain").attr("src", url);
		};
	  
		// 退出
		  function logout(){
				$.ajax({
					   url:"__URL__/logout",
					   type:"POST",
						async: false,
					    data: null,
					    dataType: "text",
					    success:function(respData) {
					    	if(respData == "success"){
							   alert("退出成功！");
							   $("#loginUser").val("");
							   checkHasLogined("__URL__/checkHasLogined");
							   if($("#personCenter").hasClass("on")){
								   $("#main").click();
							   }
					    	}
					    },
					    error:function(){
					    	
					    }
				   });
			}
  </script>
  <title>义达生态旅游</title>
</head>
<body>
	<input type="hidden" id="loginUser" value="{$_SESSION['loginUser_Index']}">
    <div class="side">
   		<div class="logo" style="margin-left: 25px;margin-top: 10px;width:85%;">
			<img src="__PUBLIC__/Image/Index/logo.png" style="width:100%;">
			<hr style="background-color:#5CC069;height:1px;margin:0px;width:95%;">
			<label style="color:#5CC069;font-size:0.9em;font-weight:bold;">
				<span style="float:left;padding-top:2px;">休闲度假哪里去</span><span style="float:right;margin-right:10px;padding-top:2px;">中国义达城外城</span>
			</label>
			<div id="loginDiv" style="display: inline-block;width: 100%;">
				<span style=""><a href="#loginModal" data-toggle="modal" style="color:#0C9BF7;font-size:0.9em;font-weight:bold;width:50%;">[登录]</a></span>
				<span style="float:right;margin-right:10px;"><a href="#registerModal" data-toggle="modal" id="registerLink" data-toggle="modal" style="color:#0C9BF7;font-size:0.9em;font-weight:bold;">[注册]</a></span>
			</div>
			<div id="hasLoginedDiv" style="display:none; width: 100%;">
				<span style=""><a href="{:U('Index/personCenter')}" target="right" id="user_display" style="color:#0C9BF7;font-size:0.9em;font-weight:bold;width:50%;">[{$display_name}]</a></span>
				<span style="float:right;margin-right:10px;"><a onclick="logout();" target="right" style="cursor:pointer;color:#0C9BF7;font-size:0.9em;font-weight:bold;">[退出]</a></span>
			</div>
		</div>
        <div id="sideMenu" style="margin:0 auto">
          <a href="{:U('Index/main')}" target="right"><label class="sideLabel on" id="main" style="background-color:#18B5FC;">首页 </label></a>
          <a href="{:U('Index/featureSpot')}" target="right"><label class="sideLabel" id="featureSpot" style="background-color:#35B348;">景点</label></a>
          <a href="{:U('Index/around')}" target="right"><label class="sideLabel" id="around" style="background-color:#9D7046;">周边游</label></a>
          <a href="{:U('Index/travelTips')}" target="right"><label class="sideLabel" id="travelTips" style="background-color:#EE9E11;">旅游攻略</label></a>
          <a>
          	<label class="sideLabel" id="personCenter" style="background-color:#30D3BE;">个人中心 </label>
          </a>
          <div class="change-city" style="">
          	<span style="float:right;margin-top:10px;">
          		 <img src="__PUBLIC__/Image/Index/location.png" style="float:left;width:auto;height:auto;">
	          	 <label id="currentCity" style="color:white;font-size:20px;font-weight: 100;float:left;">
	          	 	{$current_city}
          	 	 </label>
	          	 <a href="#" id="changeCityLink" style="margin-top:5px;margin-right:20px;color:white;font-weight: 100;"  title='<h4 style="text-align:center;">切换城市</h4>'  
         			data-container="body" data-html=true  data-toggle="popover"  data-placement="right"  data-content='
         				     <table class="entryCityTable">
        					 <foreach name="entry_cities" item="entry_city">
        					 	<tr>
        					 		<td><a href="{:U("Index/showIndex")}?id={$entry_city[0].id}">{$entry_city[0].city_name}</a></td>
        					 		<td><a href="{:U("Index/showIndex")}?id={$entry_city[1].id}">{$entry_city[1].city_name}</a></td>
        					 		<td><a href="{:U("Index/showIndex")}?id={$entry_city[2].id}">{$entry_city[2].city_name}</a></td>
        					 		<td><a href="{:U("Index/showIndex")}?id={$entry_city[3].id}">{$entry_city[3].city_name}</a></td>
        					 		<td><a href="{:U("Index/showIndex")}?id={$entry_city[4].id}">{$entry_city[4].city_name}</a></td>
        					 		<td><a href="{:U("Index/showIndex")}?id={$entry_city[5].id}">{$entry_city[5].city_name}</a></td>
        					 	</tr>
        					 </foreach>
        					 </table>
					'>[切换城市]</a>
          	 </span>
       	  </div>
       </div>
       <div style="margin-top:20px;float:right;margin-right:20px;width:180px;background-color:#B83176;height:160px;border-bottom-right-radius: 3.5em 4em;">
       	<div class="contact" style="margin-top:10px;">联系我们</div>
       	<div class="contact" style="">400-612-7715</div>
       	 <img src="__PUBLIC__/Image/Index/contact.jpg" style="float:right;width:45%;height:auto;margin-right:30%;margin-top:10px;">
       </div>
       <div class="copyright" style="margin-top:15px;float:right;text-align:center;width:100%;">
       	 <label style="color:white;font-size:10px;font-weight: 100;">Copyright&nbsp;&copy;&nbsp;2006-{$currentYear}&nbsp;义达度假</label>
       </div>
    </div>
    <div class="break">
    	<hr size="260" width="6" style="background-color:#22AB37;height:260px;">
    	<hr size="260" width="6" style="background-color:#01ADFF;height:260px;">
    	<hr size="270" width="6" style="background-color:#F29701;height:270px;">
    	<hr size="200" width="6" style="background-color:#E2007E;height:200px;">
    </div>
    <div class="main">
       <iframe name="right" id="rightMain" src="__URL__/main" style="width:100%;height:100%;" frameborder="0" scrolling="auto" width="100%" height="auto" allowtransparency="true"></iframe>
    </div>
    
<!-- 登录模态框（Modal） start-->
<include file="Public:login"/>
<!-- 登录模态框（Modal）end -->

<!-- 注册模态框（Modal） start-->
<include file="Public:register"/>
<!-- 注册模态框（Modal）end -->
</body>
</html>
   
 